import axios from 'axios'


const baseURL = process.env.NODE_ENV === 'production' ? 'http://192.168.50.251:8083' : 'http://192.168.50.251:8083'

let instance = axios.create({
    withCredentials: true
});
instance.timeout = 8000;
instance.defaults.baseURL = baseURL;
instance.defaults.headers = {"Content-Type": "application/json"};


instance.interceptors.response.use(response => {
    return Promise.resolve(response.data)
})


export function getReportMonth(companyCode) {
    return instance.get('/sso-daily/daily_view/get_month_list.do',{
        params:{
            companyCode
        }
    })
}

export function getMonthReport(monthId) {
    return instance.get('/sso-daily/daily_view/get_record_list.do',{
        params:{monthId}
    })
}

export function getDayReport(monthId,day) {
    return instance.get('/sso-daily/daily_view/get_daily_view.do',{
        params:{monthId,day}
    })
}
